<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市账单管理系统</title>
    <base href="${pageContext.request.contextPath}/">
    
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/style.css"/>
    <script type="text/javascript" src="js/jQuery-1.8.3.js"></script>
    <script type="text/javascript">
    $(function(){
    $(":input[name='billname']").val('${billname}');
    $(":input[name='tigong']").val('${tigong}');
    $(":input[name='fukuan']").val('${fukuan}');

    });
    
    
    </script>
</head>
<body>
<%@include file="top.jsp" %>
<!--主体内容-->
    <section class="publicMian ">
        <%@ include file="head.jsp" %>
        <div class="right">
            <div class="location">
                <strong>你现在所在的位置是:</strong>
                <span>账单管理</span>
            </div>
            <div class="search">
            <form action="bill/billList.csdd">
                <span>商品名称：</span>
                <input type="text" name="billname" value="${billname }" placeholder="请输入商品的名称"/>
                
                <span>供应商：</span>
                <select name="tigong" >
                    <option value="0">--请选择--</option>
                   
                    <c:forEach items="${providerlist }" var="provider">
                    <option value="${provider.id }" >${provider.proName }</option>
                    </c:forEach>
                </select>

                <span>是否付款：</span>
                <select name="fukuan">
                    <option value="0" >--请选择--</option>
                    
                    <option value="2" >已付款</option>
                    <option value="1">未付款</option>
                </select>

                <input type="submit" value="查询"/>
                </form>
                <a href="bill/billAdd.csdd">添加订单</a>
            </div>
            <!--账单表格 样式和供应商公用-->
            <table class="providerTable" cellpadding="0" cellspacing="0">
                <tr class="firstTr">
                    <th width="10%">账单编码</th>
                    <th width="20%">商品名称</th>
                    <th width="10%">供应商</th>
                    <th width="10%">账单金额</th>
                    <th width="10%">是否付款</th>
                    <th width="10%">创建时间</th>
                    <th width="30%">操作</th>
                </tr>
                <c:forEach items="${billlist.datas }" var="bill">
                <tr>
                    <td>${bill.billCode }</td>
                    <td>${bill.productName }</td>
                    <td>${bill.providerName }</td>
                    <td>&yen;：${bill.totalPrice }</td>
                    <td>
					<c:if test="${bill.isPayment==1 }">未支付</c:if>
					<c:if test="${bill.isPayment!=1 }">已支付</c:if>
						</td>
                    <td>${bill.creationDate }</td>
                    <td>
                        <a href="bill/billView.csdd?id=${bill.id }"><img src="img/read.png" alt="查看" title="查看"/></a>
                        <a href="bill/billUpdateshow.csdd?id=${bill.id }"><img src="img/xiugai.png" alt="修改" title="修改"/></a>
                        <a href="bill/billdel.csdd?id=${bill.id }" class="removeBill"><img src="img/schu.png" alt="删除" title="删除"/></a>
                    </td>
                </tr>
            </c:forEach>
            </table>
            <!-- 分页 -->
            <c:if test="${billlist.pageNo!=1}">
        <a href="bill/billList.csdd?pagenum=1&billname=${billname}&fukuan=${fukuan}&tigong=${tigong}">首页</a>
        </c:if>
            <c:if test="${ billlist.pageNo>1}">
        <a href="bill/billList.csdd?pagenum=${billlist.pageNo - 1}&billname=${billname}&fukuan=${fukuan}&tigong=${tigong}">上一页</a>
        </c:if>
        ${billlist.pageNo }/${billlist.pageNums}
        <c:if test="${billlist.pageNums > billlist.pageNo}">
        <a href="bill/billList.csdd?pagenum=${billlist.pageNo + 1}&billname=${billname}&fukuan=${fukuan}&tigong=${tigong}">下一页</a>
        </c:if>
        <c:if test="${billlist.pageNo!=billlist.pageNums}">
        <a href="bill/billList.csdd?pagenum=${billlist.pageNums}&billname=${billname}&fukuan=${fukuan}&tigong=${tigong}">最后一页</a>
        </c:if>
        </div>
    </section>

<!--点击删除按钮后弹出的页面-->
<div class="zhezhao"></div>
<div class="remove" id="removeBi">
    <div class="removerChid">
        <h2>提示</h2>
        <div class="removeMain">
            <p>你确定要删除该订单吗？</p>
            <a href="#" id="yes">确定</a>
            <a href="#" id="no">取消</a>
        </div>
    </div>
</div>

    <footer class="footer">
        版权归北大青鸟
    </footer>

<script src="js/jquery.js"></script>
<!-- <script src="js/js.js"></script> -->
<script src="js/time.js"></script>
<!-- 删除标记的弹框提示 -->
<script type="text/javascript">
$(function () {
    $('.removeBill').click(function (event) {
        $('.zhezhao').css('display', 'block');
        $('#removeBi').fadeIn();
        $('#removeBi').attr("url",$(this).attr("href"));
        return false;
    });
   $('#yes').click(function () {
        $('.zhezhao').css('display', 'none');
        $('#removeBi').fadeOut();
        location= $('#removeUse').attr("url");
        return false;
    });
    $('#no').click(function () {
        $('.zhezhao').css('display', 'none');
        $('#removeBi').fadeOut();
    });
});
</script>
</body>
</html>